import request from '@/config/axios'

// 代理会员信息 VO
export interface ShareUserVO {
  id: number // 拉新id
  memberId: number // 会员ID
  newMemberId: number // 新会员ID
}

// 代理会员信息 API
export const ShareUserApi = {
  // 查询代理会员信息分页
  getShareUserPage: async (params: any) => {
    return await request.get({ url: `/member/share-user/page`, params })
  },

  // 查询代理会员信息详情
  getShareUser: async (id: number) => {
    return await request.get({ url: `/member/share-user/get?id=` + id })
  },

  // 新增代理会员信息
  createShareUser: async (data: ShareUserVO) => {
    return await request.post({ url: `/member/share-user/create`, data })
  },

  // 修改代理会员信息
  updateShareUser: async (data: ShareUserVO) => {
    return await request.put({ url: `/member/share-user/update`, data })
  },

  // 删除代理会员信息
  deleteShareUser: async (id: number) => {
    return await request.delete({ url: `/member/share-user/delete?id=` + id })
  },

  // 导出代理会员信息 Excel
  exportShareUser: async (params) => {
    return await request.download({ url: `/member/share-user/export-excel`, params })
  }
}